home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / asm32.zip / E32.ZIP / SCRNROWS.ASM < prev    next >
Assembly Source File  |  1996-08-26  |  2KB  |  132 lines

  1. ; SCRNROWS.ASM for E32 - Copyright (C) 1994 - 1996 Douglas Herr
  2. ;  all rights reserved
  3.  
  4. ; change screen rows on EGA, VGA or RamFont monitors
  5.  
  6. ; 01/18/1996 DH: changed PICKSTR calls to PICKSTRING
  7.  
  8. include    model.inc
  9.  
  10. public    screen_rows
  11. extrn    locate:near
  12. extrn    get_screen_data:near
  13.  
  14. extrn    cursoroff:near
  15. extrn    crtinfo:near, getcrt:near
  16. extrn    pickstring:near, $tpick:near
  17. extrn    set_screen_dimensions:near
  18. extrn    htext:near, hram8043:near, hram9025:near, hram9043:near
  19. extrn    hram8029:near, hram9029:near
  20. extrn    svga132:near
  21.  
  22. include    dataseg.inc
  23. extrn    columns:byte, rows:word
  24. extrn    cursor:dword, cur_posn:word
  25.  
  26. ega    db '12 rows',0
  27. herc    db '25 rows',0
  28.     db '29 rows',0
  29.     db '43 rows',0
  30.     db 0
  31. vga    db '14 rows',0
  32.     db '25 rows',0
  33.     db '32 rows',0
  34.     db '50 rows',0
  35.     db 0
  36. vga132    db '25 rows',0
  37.     db '30 rows',0
  38.     db '43 rows',0
  39.     db '50 rows',0
  40.     db '60 rows',0
  41.     db 0
  42.  
  43. rowdata        dw 12
  44.         dw 25
  45.         dw 29
  46.         dw 43
  47.  
  48. herc_dispatch    dd hram9025
  49.         dd hram9029
  50.         dd hram9043
  51.         dd htext
  52.         dd hram8029
  53.         dd hram8043
  54. @curseg    ends
  55.  
  56. include    codeseg.inc
  57. screen_rows    proc    near
  58.     call    cursoroff
  59.     call    getcrt
  60.     mov    dx,0707h    ; row 10, column 10
  61.     xor    ebx,ebx        ; default:first selection
  62.  
  63.     cmp    al,0FFh        ; CGA?
  64.     je    exit
  65. s0:    cmp    al,128
  66.     ja    short is_herc
  67.     cmp    al,1
  68.     je    short is_ega
  69.     cmp    al,3
  70.     je    short is_vga
  71.     cmp    ax,0100h
  72.     je    short is_ega
  73.     cmp    ax,0300h
  74.     je    short is_vga
  75.     jmp    exit
  76.  
  77. is_ega:
  78.     lea    esi,ega
  79.     jmp    short v0
  80. is_vga:
  81.     lea    esi,vga
  82. v0:    cmp    columns,100
  83.     ja    short is_svga
  84.     mov    eax,offset @curseg:$tpick
  85.     call    pickstring
  86.     cmp    al,27
  87.     je    short exit
  88.     mov    ax,rowdata[ebx*2]
  89.     mov    bl,columns
  90.     call    set_screen_dimensions
  91.     jmp    short get_dim
  92.  
  93. is_svga:
  94.     lea    esi,vga132
  95.     mov    eax,offset @curseg:$tpick
  96.     call    pickstring
  97.     cmp    al,27
  98.     je    short exit
  99.     mov    eax,ebx
  100. @svga:    call    svga132
  101.     jnc    short get_dim    ; continue if no error
  102.     sub    al,1        ;  else try next lower resolution
  103.     jc    short exit    ;  exit if 25 rows doesn't work
  104.     jmp    @svga        ;  try again
  105.  
  106. is_herc:
  107.     lea    esi,herc
  108.     mov    eax,offset @curseg:$tpick
  109.     call    pickstring
  110.     cmp    al,27
  111.     je    short exit
  112.     cmp    columns,85
  113.     sbb    eax,eax        ; AX = 0FFFFh if in 80-column mode
  114.     and    eax,12        ; AX = 12 if in 80-column mode
  115.     call    herc_dispatch[eax+ebx*4]
  116.  
  117. get_dim:
  118.     call    get_screen_data
  119.     mov    dx,cur_posn
  120.     cmp    al,dh        ; above bottom of screen?
  121.     ja    short exit    ;  yup, skip
  122.     mov    dh,al        ;  else move cursor to bottom of screen
  123.     mov    esi,cursor
  124.     call    locate
  125.  
  126. exit:    clc
  127.     ret
  128. screen_rows    endp
  129.  
  130. @curseg    ends
  131.     end
  132.